public class Test1 {
    public static void main(String[] args) {
        System.out.println(score("XOXOOOXOOXXOOOOOXOOO"));
        System.out.println(1+1+2+3+1+2+1+2+3+4+5+1+2+3);
    }
    public static int score(String str){
        String[] strings = str.split("X");
        int sum = 0;
        for (int i = 0; i < strings.length; i++) {
            for (int j = 1; j <= strings[i].length(); j++) {
                sum += j;
            }
        }
        return sum;
    }
}
